package com.meida.paotui.bus.provider.service.impl;

import com.meida.common.mybatis.base.service.impl.BaseServiceImpl;
import com.meida.common.mybatis.model.PageModel;
import com.meida.common.mybatis.model.ResultBody;
import com.meida.common.mybatis.query.CriteriaQuery;
import com.meida.paotui.bus.client.entity.BusProfit;
import com.meida.paotui.bus.provider.mapper.BusProfitMapper;
import com.meida.paotui.bus.provider.service.BusProfitService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * 收益表 实现类
 *
 * @author flyme
 * @date 2019-12-10
 */
@Service
@Transactional(rollbackFor = Exception.class)
public class BusProfitServiceImpl extends BaseServiceImpl<BusProfitMapper, BusProfit> implements BusProfitService {


    @Override
    public ResultBody pageList(PageModel pageModel,Long userId,String profitType) {
        CriteriaQuery<BusProfit> cq = new CriteriaQuery(pageModel, BusProfit.class);
        cq.select(BusProfit.class, "*");
        cq.eq("userInfoId",userId);
        cq.eq("profitType",profitType);
        cq.orderByDesc("createTime");
        return basePageList(cq);
    }
}
